home *** CD-ROM | disk | FTP | other *** search
/ Practical Web Pages 2004 September / PracticalWebPages-WPG13-09-2004-Coverdisc.iso / pc / Software / Toolkit / Sothink SWF Quicker 1.5 / data1.cab / Public_Files / Effects / ActionScript / Rotate / Revolving.sqe < prev    next >
Encoding:
Text File  |  2004-06-14  |  3.1 KB  |  133 lines

  1. ========== Description Part Begin ==========
  2. name = "Revolving";
  3. description = "The characters begin to rotate horizontally one after another, faster and faster, and finally speed down till stop when the maximum speed is reached.";
  4. version = "1.00";
  5. bin = "Revolving.bin";
  6. ========== Description Part End ==========
  7.  
  8. ========== Parameter Part Begin ==========
  9. $nCharacterCount(EDIT,INT,1,1 10000,"Total Characters ","The total characters using the special effect. The value is defined by the selected characters in the movie, but can not be changed in the property box.");
  10. $nFrameCount(EDIT,INT,3,3 3,"Total Frames","It indicates the total frames of actions. The total frames of the effect is probably more than it.");
  11.  
  12. $nInterval(EDIT,INT,5,1 10000,"Interval","The time difference between the former character and the latter one beginning to change.");
  13. $bDirection(LIST,INT,1,"Left":1 "Right":0,"Direction","To control characters to change from left to right, or right to left.");
  14.  
  15. ========== Parameter Part End ==========
  16.  
  17. ========== Function Part Begin ==========
  18. nCharacterCount = 16;
  19. nFrameCount = 8;
  20. nInterval = 5;
  21. bDirection = true;
  22.  
  23.  
  24.  
  25. nIsRun = new Array(nCharacterCount );
  26. nRotateArray = new Array(nCharacterCount);
  27. nRadiusArray = new Array(nCharacterCount);
  28. nStateArray = new Array(nCharacterCount);
  29. nSpeedArray = new Array(nCharacterCount);
  30. bSignArray = new Array(nCharacterCount);
  31.  
  32.  
  33.  
  34. for( i = 1; i <= nCharacterCount; i++)
  35. {
  36.     this["c" + i]._alpha = 100;
  37.     this["c" + i]._rotation = 0;
  38.       //this["c" + i]._xscale = 100;
  39.     this["c" + i]._yscale = 100;
  40.     
  41.     nStateArray[i - 1] = 90;
  42.     nSpeedArray[i -1] = 0.1;
  43.     bSignArray[i -1] = true;
  44. }
  45.  
  46.     
  47. for (i = 1; i <= nCharacterCount  + 1; i++)
  48. {
  49.     if(bDirection)
  50.     {
  51.         if(i == 1)
  52.             nIsRun[0] = 0;
  53.         else
  54.         {
  55.             nIsRun[i - 1] = nIsRun[i - 2];
  56.             nIsRun[i - 1] += nInterval;
  57.         }
  58.     }
  59.     else
  60.     {
  61.         if(i == 1)
  62.             nIsRun[nCharacterCount -1] = 0;
  63.         else
  64.         {
  65.             nIsRun[nCharacterCount - i] = nIsRun[nCharacterCount - (i -1) ];
  66.             nIsRun[nCharacterCount - i] += nInterval ;
  67.         }
  68.         
  69.     }
  70.  
  71. }
  72.  
  73.  
  74.  
  75.  
  76. function fun()
  77. {
  78.     
  79.     for (i = 1; i <= nCharacterCount; i++)
  80.     {
  81.         if(nIsRun[i -1] < 0)
  82.         {
  83.              this["c" + i]._yscale = Math.sin(nStateArray[i -1]) * 100;
  84.              nStateArray[i -1] += (nDirection?     nSpeedArray[i -1] : -nSpeedArray[i -1]);
  85.  
  86.              if(bSignArray[i - 1])
  87.              {
  88.                  nSpeedArray[i -1] += 0.02;
  89.                 if(nSpeedArray[i -1] > 1)
  90.                     bSignArray[i -1] = false;
  91.              }
  92.             else
  93.             {
  94.                 nSpeedArray[i -1] -= 0.01;
  95.                 if(nSpeedArray[i -1] < 0)
  96.                     bSignArray[i -1]= true;
  97.  
  98.             }
  99.         }
  100.         nIsRun[i -1] --;
  101.     } 
  102.  
  103.       for (i = 1; i <= nCharacterCount; i++)
  104.     {
  105.          if(this["c" + i]._alpha >= 0)
  106.             return;
  107.         
  108.     }
  109.     
  110.     
  111.     for (i = 1; i <= nCharacterCount; i++)
  112.     {
  113.         this["c" + i]._x = nCentreXArray[i -1];
  114.         this["c" + i]._y = nCentreYArray[i -1];
  115.  
  116.         gotoAndPlay(1);
  117.     }
  118.  
  119.  
  120. function again()
  121. {
  122.     gotoAndPlay(2);
  123. }
  124.  
  125.  
  126. ========== Function Part End ==========
  127.  
  128. ========== Frame Part Begin ==========
  129. $frame(fun,1,-1,"fun");
  130. $frame(fun,2,-1,"fun");
  131. $frame(again,3,-1,"again");
  132. ========== Frame Part End ==========